/**
 * Created by qunxing.du on 2016/9/20.
 * Copyright 2016 汉威.智慧环保事业部 Limited.
 * All rights reserved.
 */
package com.hw.one.collect.pollution.server.event;

import com.hw.one.collect.pollution.server.Server;
import org.apache.log4j.Logger;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ApplicationContextEvent;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;

/**
 * 污染源服务器监听器
 */
@Component
public class PollutionServerListenter implements ApplicationListener<ApplicationContextEvent> {
    private static Logger log = Logger.getLogger(PollutionServerListenter.class);
    @Override
    public void onApplicationEvent(ApplicationContextEvent event) {
        if(event instanceof ContextRefreshedEvent){
            log.info(event.toString());
           // new Server().init(30003);
        }
    }
}
